package com.walker.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
@RefreshScope
@ConfigurationProperties(prefix = "app.config")
public class AppConfig {

    private String message;
    private String apiKey;
    private boolean featureEnabled;
    private List<String> tj;  // 新增 List 字段

    // getter 和 setter 方法
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getApiKey() {
        return apiKey;
    }

    public void setApiKey(String apiKey) {
        this.apiKey = apiKey;
    }

    public boolean isFeatureEnabled() {
        return featureEnabled;
    }

    public void setFeatureEnabled(boolean featureEnabled) {
        this.featureEnabled = featureEnabled;
    }

    // TJ 字段的 getter 和 setter
    public List<String> getTj() {
        return tj;
    }

    public void setTj(List<String> tj) {
        this.tj = tj;
    }

    // 添加 toString 方法便于调试
    @Override
    public String toString() {
        return "AppConfig{" +
                "message='" + message + '\'' +
                ", apiKey='" + apiKey + '\'' +
                ", featureEnabled=" + featureEnabled +
                ", tj=" + tj +
                '}';
    }
}